package com.handinglian.ai.notice.enums;

public enum ExecuteStateEnum {
    NOT_EXECUTE(0,"未执行"),
    EXECUTED(1,"已执行");

    public static ExecuteStateEnum valueOfOrdinal(Integer ordinal) {
        return ordinal == null || ordinal >= values().length ? null : values()[ordinal];
    }
    public static ExecuteStateEnum valueOfDesc(String desc) {
        for(ExecuteStateEnum executeStateEnum : ExecuteStateEnum.values()){
            if(desc.equals(executeStateEnum.getDescription())){
                return executeStateEnum;
            }
        }
        return null;
    }
    public static ExecuteStateEnum valueOfKey(Integer key){
        for(ExecuteStateEnum executeStateEnum : ExecuteStateEnum.values()){
            if(executeStateEnum.getKey()==key){
                return executeStateEnum;
            }
        }
        return null;
    }
    private final Integer key;
    private final String description;

    ExecuteStateEnum(Integer key, String description) {
        this.key = key;
        this.description = description;
    }

    public Integer getKey() {
        return key;
    }
    public String getDescription() {
        return this.description;
    }
}
